package com.JdkProxy.firstexample.utils;

import java.lang.reflect.InvocationHandler;
import java.lang.reflect.Proxy;

/**
 * @User c.c
 * @Since 2022/10/24
 * @Time 10:38
 * @Description 代理工具
 */

public class Proxyutils {

  public static <T> T getClass(Class<T> classInterface, InvocationHandler proxy){
    T docker = (T) Proxy.newProxyInstance(proxy.getClass().getClassLoader(), new Class[]{classInterface}, proxy);
    return docker;
  }
}
